/*项目信息管理-详情-项目基本信息*/
import 'package:flutter/cupertino.dart';
import 'package:frametrim/appviews/textUpPhoneView.dart';
import 'package:frametrim/appviews/textUpTextView.dart';
import 'package:frametrim/appviews/textUpTextViewJump.dart';

import '../../model/DistrictCommonM.dart';
import '../../model/ProjectMessManagerBasicM.dart';
import '../../utility/Tools.dart';

class PeojectMessDetailsPage01 extends StatefulWidget {
  late ProjectMessManagerBasicRecords? data;

  //项目类别
  List<DepartmentList> mProjectTypelist;

  //管辖划分
  List<DepartmentList> mProjectDeptlist;

  //资金来源
  List<DepartmentList> mProjectMoneySourcelist ;

  @override
  State<StatefulWidget> createState() => PeojectMessDetailsPage01State();

  PeojectMessDetailsPage01(
      this.data, this.mProjectTypelist, this.mProjectDeptlist,this.mProjectMoneySourcelist);
}

class PeojectMessDetailsPage01State extends State<PeojectMessDetailsPage01> {
  late ScrollPhysics physics = NeverScrollableScrollPhysics();

  @override
  Widget build(BuildContext context) {
    return Container(
      child: ListView(
        //禁止滚动
        physics: physics,
        padding: EdgeInsets.only(top: 10),
        children: buildWidget(),
      ),
    );
  }

  List<Widget> buildWidget() {
    List<Widget> children = [];
    var project = widget.data!.project!;
    var projectInfo = widget.data!.projectInfo!;
    children.add(TextUpTextView('项目曾名称', Tools.TextNullToLine(project.otherName)));
    children.add(
        TextUpTextViewJump('施工许可证号', Tools.TextNullToLine(project.constructionPermit),
            '查看施工许可证',Tools.TextNullToLine(project.constructionPermitUrl)));
    children.add(TextUpTextView('监管部门', Tools.TextNullToLine(project.superviseCompany)));
    children.add(TextUpTextView(
        '项目区域',
        Tools.TextNullToLine("${Tools.TextNullToLine(project.projectProvinceName)}") +
            "/" +
            Tools.TextNullToLine("${Tools.TextNullToLine(project.projectCityName)}") +
            "/" +
            Tools.TextNullToLine("${Tools.TextNullToLine(project.projectCountyName)}")));
    children.add(TextUpTextView('项目详细地址', Tools.TextNullToLine(project.address)));
    children.add(TextUpTextView('项目所在经纬度',  Tools.TextNullToLine("${project.latitude}") +
        "/" +
        Tools.TextNullToLine("${project.longitude}")));
    children.add(TextUpTextView('是否重点项目', Tools.getYesOrNoName(project.isImportant!)));
    children.add(TextUpTextView('是否新批项目', Tools.getYesOrNoName(project.isNewBatch)));
    children.add(TextUpTextView('资金来源', Tools.getDistrictName(project.moneySource,widget.mProjectMoneySourcelist)));
    children.add(TextUpTextView('施工合同额', '${Tools.TextNullToLine(project.constructionAmount.toString())}万元'));
    children.add(TextUpTextView('劳务分包合同额', '${Tools.TextNullToLine(project.laborSubcontractAmount.toString())}万元'));
    children.add(TextUpTextView('合同开工日期', Tools.TextNullToLine(project.startDate)));
    children.add(TextUpTextView('合同竣工日期', Tools.TextNullToLine(project.endDate)));
    children.add(TextUpTextView('工期', '${Tools.TextNullToLine(project.totalDay.toString())}天'));
    children.add(TextUpTextView('入库时间', Tools.TextNullToLine(project.createTime)));
    children.add(TextUpPhoneView('项目经理', Tools.TextNullToLine(projectInfo.constructionUnitLeader),
        Tools.TextNullToLine( projectInfo.constructionUnitLeaderMobile)));
    children.add(TextUpPhoneView('总监理工程师',  Tools.TextNullToLine(projectInfo.superviseUnitManager),
        Tools.TextNullToLine( projectInfo.superviseUnitManagerMobile)));
    children.add(TextUpPhoneView('劳务负责人', Tools.TextNullToLine(projectInfo.laborManager),
        Tools.TextNullToLine(projectInfo.laborManagerMobile)));
    children.add(TextUpPhoneView('建设单位负责人', Tools.TextNullToLine(projectInfo.constructionDirector),
        Tools.TextNullToLine(projectInfo.constructionDirectorPhone)));
    children.add(TextUpTextView('建设单位统一社会信用代码', Tools.TextNullToLine(projectInfo.constructionCreditCode)));
    children.add(TextUpTextView('监理单位统一社会信用代码', Tools.TextNullToLine(projectInfo.supervisorCreditCode)));
    children.add(TextUpTextView('建设资金是否到位', Tools.getYesOrNoName(projectInfo.isConstructionCapital)));
    children.add(TextUpTextView('建设资金金额(万元)', '${Tools.TextNullToLine(projectInfo.constructionCapital.toString())}万元'));
    children.add(TextUpTextView('建设单位是否提供工程款支付担保',Tools.getYesOrNoName(projectInfo.isConstructionUnitPay)));
    children.add(TextUpTextView('建设单位工程款支付担保金额(万元)', '${Tools.TextNullToLine(projectInfo.constructionUnitPayCapital.toString())}万元'));
    children.add(TextUpTextView('建设单位是否缴纳农民工工资保证金',Tools.getYesOrNoName(projectInfo.isConstructionUnitBond)));
    children.add(TextUpTextView('建设单位缴纳农民工工资保证金金额(万元)', '${Tools.TextNullToLine(projectInfo.constructionUnitBond.toString())}万元'));
    children.add(TextUpTextView('建设单位保证金缴纳方式', '--'));
    children.add(TextUpTextView('施工总承包单位是否缴纳农民工工资保证金', Tools.getYesOrNoName(projectInfo.isGeneralContractorSalaryBond)));
    children.add(TextUpTextView('施工单位保证金缴纳方式', '--'));
    children.add(TextUpTextView('施工单位缴纳农民工工资保证金金额(万元)', '${Tools.TextNullToLine(projectInfo.generalContractorSalaryBond.toString())}万元'));
    children.add(TextUpTextViewJump('是否设立维权公示牌(万元)', Tools.getYesOrNoName(projectInfo.isShowBulletinBoard), '查看维权公示牌凭证',Tools.TextNullToLine(projectInfo.showBulletinBoardUrl)));
    return children;
  }

}
